A typical communications network includes a lot of different types of network devices. For example, a typical communications network may include host devices, which act as the source or destination of a particular communication session, routers and/or switches, which act to forward communication session traffic toward their appropriate destinations, and security devices, which provide, for example, firewall or other security functionality.
A network device may store a separate communication session data structure for each communication session handled by the network device. The data structures may store current state information for the communication sessions. Typically, each communication session data structure may include a timer that indicates the lifetime of the communication session. At a predetermined interval (e.g., every second), an ager may scan each communication session data structure and decrease the associated timer in those instances when a new packet has not been received for that communication session. If a new packet has been received for a communication session, the ager may reset the timer for that communication session (e.g., reset the timer to its maximum value for that communication session). If a timer has expired (e.g., counted down from its maximum value to zero) for a particular communication session, the ager may recycle the corresponding communication session.
Therefore, during each time interval, the ager scans the data structures for all ongoing communication sessions. During this scanning process, processing of data packets may be blocked. Since network devices may handle thousands of ongoing communication sessions at one time, the ager may scan thousands of communication sessions during each time interval, decreasing throughput and consuming a large amount of processing power of the network device.